<template>
	<view>
		<view id="myView">这是个测试组件{{num}}</view>
	</view>
</template>

<script>
	export default {
		name: "test",
		data() {
			return {
				num: 3
			};
		},
		beforeCreate() {
			console.log('实例已经开始初始化了')
			console.log(this.num)
			this.intId =setInterval(()=>{
				console.log('执行定时器')
			},1000)
		},
		created() {
			console.log('created',this.num)
		},
		beforeMount() {
			console.log('beforemouont',document.getElementById('myView'))
		},
		mounted() {
			console.log('mounted',document.getElementById('myView'))
		},
		destroyed() {
			console.log('组件销毁了')
			clearInterval(this.intId)
		}
	}
</script>

<style>

</style>
